<extend  name="Public:base" />
<block name="head">
    <style>
        .layui-form-label{
            width: 90px;
        }
    </style>
</block>
<block name="content_header">
    <div class="content-header">
        <h2 class="content-title">系统配置</h2>
        <span class="layui-breadcrumb">
            <a href="{:U('Index/index')}">首页</a>
            <a>系统管理</a>
            <a><cite>系统配置</cite></a>
        </span>
    </div>
</block>
<block name="toolbar"></block>
<block name="content_body">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">系统设置</li>
            <li> 短信配置 </li>
            <!-- <li> 待定 </li> -->
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show layui-card">
                <form class="layui-form" style="padding-top: 25px">
                    <volist name="config" id="item">
                        <div class="layui-form-item" style="width: 800px">
                            <label class="layui-form-label" style="width: 116px">{$item.alias}</label>
                            <div class="layui-input-inline" style="width:300px;">
                                <input type="text" name="{$item.name}" value="{$item.value}" placeholder="{$item.alias}" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">{$item.brief}</div>
                        </div>
                    </volist>
                    <div class="layui-form-item">
                        <label class="layui-form-label"> </label>
                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn" lay-submit lay-filter="submitconfig">保存</button>
                            <button type="button" class="layui-btn" type="reset" lay-reset lay-filter="reset">重置</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item layui-card">
                <form class="layui-form" style="padding-top: 25px">
                    <volist name="smsinfo" id="item">
                        <if condition="$item.name eq sms_switch">
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 116px">{$item.alias}</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="radio" name="{$item.name}" value="1" title="开" <if condition="$item.value eq 1">checked</if>>
                                    <input type="radio" name="{$item.name}" value="0" title="关" <if condition="$item.value eq 0">checked</if>>
                                </div>
                                <div class="layui-form-mid layui-word-aux">{$item.brief}</div>
                            </div>
                        <else />
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 116px">{$item.alias}</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="{$item.name}" value="{$item.value}" placeholder="{$item.alias}" autocomplete="off" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">{$item.brief}</div>
                            </div>
                        </if>
                    </volist>
                    <div class="layui-form-item">
                        <label class="layui-form-label"> </label>
                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn" lay-submit lay-filter="submitsms">保存</button>
                            <button type="button" class="layui-btn" type="reset" lay-reset lay-filter="reset">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

</block>
<block name="foot_script">
    <script>
        //JavaScript代码区域
        layui.use('form', function(){
            var form = layui.form;
            form.on('submit(submitconfig)',function (data) {
                $.post('{:U("Config/index")}',data.field,function (res) {
                    layer.msg(res.msg,{time:1000});
                });
                return false;
            });
            form.on('submit(submitsms)',function (data) {
                $.post('{:U("Config/savesms")}',data.field,function (res) {
                    layer.msg(res.msg,{time:1000});
                });
                return false;
            });
        });
    </script>
</block>